#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, v;
  cin >> s >> v;
  int x = 10 + ceil(1.0 * s / v);

  int chufa = (1440 + 480 - x) % 1440;
  cout << chufa / 60 << ":" << chufa % 60;

  return 0;
}